package com.yc.navy.dayfresh.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.navy.dayfresh.bean.MemberInfo;
import com.yc.navy.dayfresh.mapper.IMemberInfoMapper;
import com.yc.navy.dayfresh.service.IMemberInfoService;
import com.yc.navy.dayfresh.util.StringUtil;

@Service
public class MemberInfoServiceImpl implements IMemberInfoService {
	@Autowired
	private IMemberInfoMapper memberInfoMapper;
	
	@Override
	public int reg(MemberInfo mf) {
		if(StringUtil.checkNull(mf.getNickName(),mf.getTel(),mf.getEmail(),mf.getPwd())) {
			return -1;
		}
		return memberInfoMapper.reg(mf);
	}

	@Override
	public MemberInfo login(MemberInfo mf) {
		if(StringUtil.checkNull(mf.getNickName(), mf.getPwd())) {
			return null;
		}
		return memberInfoMapper.login(mf);
	}

}
